P32A 001000 |
rt |
rs |
rd |
ADDQH.W 0 |
0010001 |
101 |
P32A 001000 |
rt |
rs |
rd |
ADDQH_R.W 1 |
0010001 |
101 |
6 |
5 |
5 |
5 |
1 |
7 |
3 |
ADDQH[_R].W |
Add Fractional Words And Shift Right to Halve Results | |
ADDQH.W rd, rs, rt |
DSP-R2 |
Add Fractional Words And Shift Right to Halve Results |
ADDQH_R.W rd, rs, rt |
DSP-R2 |
Add Fractional Words And Shift Right to Halve Results |
Add Fractional Words And Shift Right to Halve Results
Fractional addition of word vectors, with a right shift by one bit to halve the result, with optional rounding.
rd = round((rs31..0 + rt31..0) >> 1)
The word in register rs is added to the word in register rt to create an interim 33-bit result.
In the non-rounding instruction variant, the interim result is then shifted right by one bit before being written to the destination register rd.
In the rounding version of the instruction, a value of 1 is added at the least-si gnificant bit position of the int erim result; the interim result is then right-shifted by one bit and written to the destination register.
This instruction does not modify the DSPControl register.
No data-dependent exceptions are possible.
The operands must be a value in the specified format. If they are not, the results are UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.
ADDQH.W ValidateAccessToDSP2Resources() tempA31..0 = rightShift1AddQ32( GPR[rs]31..0 , GPR[rt]31..0 ) GPR[rd]31..0 = tempA31..0 ADDQH_R.W ValidateAccessToDSP2Resources() tempA31..0 = roundRightShift1AddQ32( GPR[rs]31..0 , GPR[rt]31..0 ) GPR[rd]31..0 = tempA31..0 function rightShift1AddQ32( a31..0 , b31..0 ) temp32..0 = (( a31 || a31..0 ) + ( b31 || b31..0 )) return temp32..1 endfunction rightShift1AddQ32 function roundRightShift1AddQ32( a31..0 , b31..0 ) temp32..0 = (( a31 || a31..0 ) + ( b31 || b31..0 )) temp32..0 = temp32..0 + 1 return temp32..1 endfunction roundRightShift1AddQ32
Reserved Instruction, DSP Disabled